/**
 * API 相关常量
 */

// API 端点
export const API_ENDPOINTS = {
  // 认证相关
  LOGIN: '/auth/login',
  LOGOUT: '/auth/logout',
  REFRESH_TOKEN: '/auth/refresh',
  USER_INFO: '/auth/user/info',
  
  // 用户管理
  USERS: '/system/users',
  USER_DETAIL: (id: string) => `/system/users/${id}`,
  
  // 角色管理
  ROLES: '/system/roles',
  ROLE_DETAIL: (id: string) => `/system/roles/${id}`,
  
  // 菜单管理
  MENUS: '/system/menus',
  MENU_DETAIL: (id: string) => `/system/menus/${id}`,
  
  // 部门管理
  DEPTS: '/system/depts',
  DEPT_DETAIL: (id: string) => `/system/depts/${id}`,
  
  // 系统设置
  SETTINGS: '/system/settings',
  
  // 监控相关
  ONLINE_USERS: '/monitor/online',
  LOGIN_LOGS: '/monitor/loginlogs',
  OPER_LOGS: '/monitor/operlogs',
  
  // 文件上传
  UPLOAD: '/common/upload',
  UPLOAD_AVATAR: '/common/upload/avatar'
} as const

// 请求方法
export const HTTP_METHODS = {
  GET: 'GET',
  POST: 'POST',
  PUT: 'PUT',
  DELETE: 'DELETE',
  PATCH: 'PATCH'
} as const

// 请求头
export const HEADERS = {
  CONTENT_TYPE: 'Content-Type',
  AUTHORIZATION: 'Authorization',
  ACCEPT: 'Accept',
  USER_AGENT: 'User-Agent'
} as const

// 内容类型
export const CONTENT_TYPES = {
  JSON: 'application/json',
  FORM_DATA: 'multipart/form-data',
  URL_ENCODED: 'application/x-www-form-urlencoded'
} as const

// 响应状态
export const RESPONSE_STATUS = {
  SUCCESS: 'success',
  ERROR: 'error',
  WARNING: 'warning'
} as const

// 错误码
export const ERROR_CODES = {
  NETWORK_ERROR: 'NETWORK_ERROR',
  TIMEOUT_ERROR: 'TIMEOUT_ERROR',
  UNAUTHORIZED: 'UNAUTHORIZED',
  FORBIDDEN: 'FORBIDDEN',
  NOT_FOUND: 'NOT_FOUND',
  SERVER_ERROR: 'SERVER_ERROR',
  VALIDATION_ERROR: 'VALIDATION_ERROR'
} as const
